package org.jflame.devAide.component;

import java.io.Serializable;
import java.time.LocalDateTime;

import javafx.beans.property.SimpleStringProperty;

public class NoteInfo implements Serializable {

    private static final long serialVersionUID = -8907315165927080429L;

    private Integer id;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private String type;// html,md
    private SimpleStringProperty title = new SimpleStringProperty();
    private SimpleStringProperty content = new SimpleStringProperty();

    public NoteInfo() {
    }

    public NoteInfo(String _title) {
        this(_title, null);
    }

    public NoteInfo(String _title, String _content) {
        setTitle(_title);
        if (_content != null) {
            setContent(_content);
        }
        createTime = LocalDateTime.now();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title.get();
    }

    public SimpleStringProperty titleProperty() {
        return title;
    }

    public void setTitle(String title) {
        this.title.set(title);
    }

    public SimpleStringProperty contentProperty() {
        return content;
    }

    public String getContent() {
        return content.get();
    }

    public void setContent(String content) {
        this.content.set(content);
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

}
